﻿///////////////////////////////////////////////////////////////////////////////
//
// This file is part of the BassDrop project
//   https://code.google.com/p/bass-drop/
//
//
// Creator:	Gergely Krajcsovszki (krajcsovszkig@hotmail.com)
// Date:	2013-07-27 13:45
//
//
// Copyright © 2013-2014. Gergely Krajcsovszki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;

namespace BassDrop.Core.Common.Localization
{
	/// <summary>
	/// Class containing the strings used in the program
	/// </summary>
	public static partial class Strings
	{
		/// <summary>
		/// Loads the strings for the exceptions
		/// </summary>
		/// <param name="strings">the xml node containing the localized strings</param>
		private static void LoadExceptionStrings( XElement strings )
		{
			SetProperty( strings, "ExceptionMoveTargetExists", "Failed to move file: the target file exists and cannot be overwritten." );
			SetProperty( strings, "ExceptionFailedToLoadStrings", "Failed to load the localized strings for the application. The defaults will be used." );
			SetProperty( strings, "ExceptionBadLockfile", "The format of the lock file is wrong." );
			SetProperty( strings, "ExceptionBadSkinFile", "The skin file being loaded is wrong." );
			SetProperty( strings, "ExceptionBadVectorClockFile", "Vector clock file is in a wrong format." );
			SetProperty( strings, "ExceptionCompound", "Multiple errors occured" );
			SetProperty( strings, "ExceptionCompoundSublist", "List of exceptions:" );
			SetProperty( strings, "ExceptionControllerExists", "An instance of the Controller already exists." );
			SetProperty( strings, "ExceptionDefaultCloudUnavailable", "Default cloud connection unavailable." );
			SetProperty( strings, "ExceptionFormatNotSupported", "File format {0} cannot be opened by the application, nor any of the loaded plugins. (File: {1})" );
			SetProperty( strings, "ExceptionMissingGuiForOptionsItem", "No suitable displaying class found for the options item." );
			SetProperty( strings, "ExceptionMissingMediaFile", "Media file missing." );
			SetProperty( strings, "ExceptionPlaylistIndexOutOfRange", "Selected playlist index is out of the possible range." );
			SetProperty( strings, "ExceptionPlaylistItemNotFound", "Selected playlist item is not in the playlist." );
			SetProperty( strings, "ExceptionRemoteFileUnavailable", "Remote file unavailable. Check if you have a default cloud provider selected." );
			SetProperty( strings, "ExceptionPlaylistToSaveIsNull", "Playlist to save is null." );
			SetProperty( strings, "ExceptionPathKindInvalid", "Invalid PathKind value." );
			SetProperty( strings, "ExceptionShutdownFailed", "The application failed to close properly. Click OK to force close it." );
			SetProperty( strings, "ExceptionUnhandled", "An exception was unhandled, so the program now needs to close. Sorry for the inconvenience." );
		}

		/// <summary>
		/// Message for exception thrown when the target exists and cannot be
		/// overwritten when moving a file
		/// </summary>
		public static string ExceptionMoveTargetExists
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when the application is unable to load translations
		/// </summary>
		public static string ExceptionFailedToLoadStrings
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when a lockfile is malformatted
		/// </summary>
		public static string ExceptionBadLockfile
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when a lockfile is malformatted
		/// </summary>
		public static string ExceptionBadSkinFile
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when a vector clock file is malformatted
		/// </summary>
		public static string ExceptionBadVectorClockFile
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when multiple exceptions occur
		/// </summary>
		public static string ExceptionCompound
		{
			get;
			private set;
		}

		/// <summary>
		/// Label for the list of child expressions in the ToString method of a compound exception
		/// </summary>
		public static string ExceptionCompoundSublist
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when trying to create an instance of the controller after one is already created
		/// </summary>
		public static string ExceptionControllerExists
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when the default cloud connection is unavailable
		/// </summary>
		public static string ExceptionDefaultCloudUnavailable
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when trying to open a not supported file
		/// </summary>
		public static string ExceptionFormatNotSupported
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when an options item cannot be displayed, because no GUI is created for it
		/// </summary>
		public static string ExceptionMissingGuiForOptionsItem // TODO: típust is írja ki
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when a media file is missing
		/// </summary>
		public static string ExceptionMissingMediaFile
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when trying to set the selected index on a playlist to an invalid value
		/// </summary>
		public static string ExceptionPlaylistIndexOutOfRange
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when trying to set the selected item on a playlist to one that isn't there
		/// </summary>
		public static string ExceptionPlaylistItemNotFound
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when trying to fiddle with an unavailable remote (cloud) file
		/// </summary>
		public static string ExceptionRemoteFileUnavailable
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when trying to save a null playlist
		/// </summary>
		public static string ExceptionPlaylistToSaveIsNull
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when converting a relative path with an invalid Registry.PathKind
		/// </summary>
		public static string ExceptionPathKindInvalid
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when the program fails to quit
		/// </summary>
		public static string ExceptionShutdownFailed
		{
			get;
			private set;
		}

		/// <summary>
		/// Message for exception thrown when an unhandled exception forces the program to quit
		/// </summary>
		public static string ExceptionUnhandled
		{
			get;
			private set;
		}
	}
}
